Text File | 1998-08-11 | 652 b | 13 lines | [TEXT/ScoM]
permute-unique elements
This function enables a source list of to generate multiple lists of all the permutations of the list. Unlike the function permute, permute-unique generates multiple lists that in which the patterns of elements are consistently 'unique' with each other.
(permute-unique '(a a b b))
=> ((a a b b) (a b a b) (a b b a) (b a a b) (b a b a) (b b a a))
(permute '(a a b b))
=> ((a a b b) (a a b b) (a b a b) (a b b a) (a b a b) (a b b a)
(a a b b) (a a b b) (a b a b) (a b b a) (a b a b) (a b b a)
(b a a b) (b a b a) (b a a b) (b a b a) (b b a a) (b b a a)
(b a a b) (b a b a) (b a a b) (b a b a) (b b a a) (b b a a))